using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter19
{
	/// <summary>
	/// Example05: How Many Moles of Gas in a Container?
	/// An ideal gas occupies a volume of 100 cm^3 at 20 C
	/// and 100 Pa. Find the number of moles of gas in the 
	/// container.
	/// n = 4.11 \times 10^{-6} mol
	/// </summary>
	public class Example05
	{
		public Example05()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Temperature t = new L.Temperature();
			t.C = 20.0;
			t.FindAbsoluteFromCelsius();

			L.Volume v = new L.Volume();
			v.mCUBE = 100.0E-6;

			L.Pressure p = new L.Pressure();
			p.Pa = 100.0;

			L.IdealGas gas = new L.IdealGas();
			gas.Temperature = t.K;
			gas.Volume = v.mCUBE;
			gas.Pressure = p.Pa;
			gas.FindMole();

			result+=Convert.ToString(gas.Mole);        
		}
	}
}
